#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;
    if (n <= 1 || n >= 12)
    {
        cout << 0;
        return 0;
    }

    int jieSum = 0;
    for (int i = 1; i <= n; i++)
    {
        int jie = 1;
        for (int j = i; j > 0; j--)
        {
            jie *= j;
        }
        jieSum += jie;
    }
    cout << jieSum;
    
    
    return 0;
}